﻿namespace Hidistro.Membership.Context
{
    using Hidistro.Core;
    using Hishop.Components.Validation.Validators;
    using System;
    using System.Globalization;
    using System.Runtime.CompilerServices;
    using System.Xml;

    public class SiteSettings
    {
        public SiteSettings(string siteUrl)
        {
            this.SiteUrl = siteUrl;
            this.IsOpenSiteSale = true;
            this.Disabled = false;
            this.SiteDescription = "最安全，最专业的网上商店系统";
            this.Theme = "default";
            this.VTheme = "default";
            this.AliOHTheme = "default";
            this.WapTheme = "default";
            this.SiteName = "橘色科技";
            this.LogoUrl = "http://res.juseshop.com/utility/pics/logo.jpg";
             //big img
            this.DefaultProductImage = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail1 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail2 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail3 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail4 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail5 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail6 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail7 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail8 = "http://res.juseshop.com/utility/pics/none.gif";

            //Small img
            this.DefaultProductImageUrl1="http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductImageUrl2 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductImageUrl3 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductImageUrl4 = "http://res.juseshop.com/utility/pics/none.gif";
            this.DefaultProductThumbnail5 = "http://res.juseshop.com/utility/pics/none.gif"; 
            //Mobels
             this.MobelImageUrl9= "http://res.juseshop.com/utility/pics/none.gif";




            this.VipCardBG = "/storage/master/Vipcard/vipbg.png";
            this.VipCardQR = "/storage/master/Vipcard/vipqr.jpg";
            this.DecimalLength = 0;
            this.PointsRate = 1M;
            this.OrderShowDays = 7;
            this.CloseOrderDays = 3;
            this.FinishOrderDays = 7;
            this.IsOpenSiteSale = true;
            this.EnableMobileClient = false;
            this.EnablePodRequest = true;
        }

        public static SiteSettings FromXml(XmlDocument doc)
        {
          
            XmlNode node = doc.SelectSingleNode("Settings");
            int DecimalLength = int.Parse(node.SelectSingleNode("DecimalLength").InnerText);
            return new SiteSettings(node.SelectSingleNode("SiteUrl").InnerText) { 
                AssistantIv = node.SelectSingleNode("AssistantIv").InnerText, AssistantKey = node.SelectSingleNode("AssistantKey").InnerText,
                DecimalLength = int.Parse(node.SelectSingleNode("DecimalLength").InnerText), 
                DefaultProductImage = node.SelectSingleNode("DefaultProductImage").InnerText, 
                DefaultProductThumbnail1 = node.SelectSingleNode("DefaultProductThumbnail1").InnerText, 
                DefaultProductThumbnail2 = node.SelectSingleNode("DefaultProductThumbnail2").InnerText, 
                DefaultProductThumbnail3 = node.SelectSingleNode("DefaultProductThumbnail3").InnerText, 
                DefaultProductThumbnail4 = node.SelectSingleNode("DefaultProductThumbnail4").InnerText, 
                DefaultProductThumbnail5 = node.SelectSingleNode("DefaultProductThumbnail5").InnerText,
                DefaultProductThumbnail6 = node.SelectSingleNode("DefaultProductThumbnail6").InnerText, 
                DefaultProductThumbnail7 = node.SelectSingleNode("DefaultProductThumbnail7").InnerText, 
                DefaultProductThumbnail8 = node.SelectSingleNode("DefaultProductThumbnail8").InnerText,
                
                MobelImageUrl9 = node.SelectSingleNode("MobelImageUrl9").InnerText,

                DefaultProductImageUrl1 = node.SelectSingleNode("DefaultProductImageUrl1").InnerText,
                DefaultProductImageUrl2 = node.SelectSingleNode("DefaultProductImageUrl2").InnerText,
                DefaultProductImageUrl3 = node.SelectSingleNode("DefaultProductImageUrl3").InnerText,
                DefaultProductImageUrl4 = node.SelectSingleNode("DefaultProductImageUrl4").InnerText,
                DefaultProductImageUrl5 = node.SelectSingleNode("DefaultProductImageUrl5").InnerText,

                CheckCode = node.SelectSingleNode("CheckCode").InnerText, IsOpenSiteSale = bool.Parse(node.SelectSingleNode("IsOpenSiteSale").InnerText), Disabled = bool.Parse(node.SelectSingleNode("Disabled").InnerText), ReferralDeduct = int.Parse(node.SelectSingleNode("ReferralDeduct").InnerText), 
                EtaoID = node.SelectSingleNode("EtaoID").InnerText, IsCreateFeed = bool.Parse(node.SelectSingleNode("IsCreateFeed").InnerText), Footer = node.SelectSingleNode("Footer").InnerText, RegisterAgreement = node.SelectSingleNode("RegisterAgreement").InnerText, HtmlOnlineServiceCode = node.SelectSingleNode("HtmlOnlineServiceCode").InnerText, LogoUrl = node.SelectSingleNode("LogoUrl").InnerText, OrderShowDays = int.Parse(node.SelectSingleNode("OrderShowDays").InnerText), CloseOrderDays = int.Parse(node.SelectSingleNode("CloseOrderDays").InnerText), FinishOrderDays = int.Parse(node.SelectSingleNode("FinishOrderDays").InnerText), TaxRate = decimal.Parse(node.SelectSingleNode("TaxRate").InnerText), PointsRate = decimal.Parse(node.SelectSingleNode("PointsRate").InnerText), SearchMetaDescription = node.SelectSingleNode("SearchMetaDescription").InnerText, SearchMetaKeywords = node.SelectSingleNode("SearchMetaKeywords").InnerText, SiteDescription = node.SelectSingleNode("SiteDescription").InnerText, SiteName = node.SelectSingleNode("SiteName").InnerText, SiteUrl = node.SelectSingleNode("SiteUrl").InnerText, 
                UserId = null, Theme = node.SelectSingleNode("Theme").InnerText, YourPriceName = node.SelectSingleNode("YourPriceName").InnerText, EmailSender = node.SelectSingleNode("EmailSender").InnerText, EmailSettings = node.SelectSingleNode("EmailSettings").InnerText, SMSSender = node.SelectSingleNode("SMSSender").InnerText, SMSSettings = node.SelectSingleNode("SMSSettings").InnerText, SiteMapTime = node.SelectSingleNode("SiteMapTime").InnerText, SiteMapNum = node.SelectSingleNode(" SiteMapNum").InnerText, TaobaoShippingType = int.Parse(node.SelectSingleNode("TaobaoShippingType").InnerText), EnabledBFD = bool.Parse(node.SelectSingleNode("EnabledBFD").InnerText), BFDUserName = node.SelectSingleNode("BFDUserName").InnerText, EnabledCnzz = bool.Parse(node.SelectSingleNode("EnabledCnzz").InnerText), CnzzUsername = node.SelectSingleNode("CnzzUsername").InnerText, CnzzPassword = node.SelectSingleNode("CnzzPassword").InnerText, EnableMobileClient = bool.Parse(node.SelectSingleNode("EnableMobileClient").InnerText), 
                MobileClientSpread = node.SelectSingleNode("MobileClientSpread").InnerText, CellPhoneUserCode = node.SelectSingleNode("CellPhoneUserCode").InnerText, CellPhoneToken = node.SelectSingleNode("CellPhoneToken").InnerText, ApplicationMark = node.SelectSingleNode("ApplicationMark").InnerText, SiteToken = node.SelectSingleNode("SiteToken").InnerText, SiteTime = node.SelectSingleNode("SiteTime").InnerText, WeixinAppId = node.SelectSingleNode("WeixinAppId").InnerText, WeixinAppSecret = node.SelectSingleNode("WeixinAppSecret").InnerText, WeixinToken = node.SelectSingleNode("WeixinToken").InnerText, WeixinPaySignKey = node.SelectSingleNode("WeixinPaySignKey").InnerText, WeixinPartnerID = node.SelectSingleNode("WeixinPartnerID").InnerText, WeixinPartnerKey = node.SelectSingleNode("WeixinPartnerKey").InnerText, VTheme = node.SelectSingleNode("VTheme").InnerText, VipCardLogo = node.SelectSingleNode("VipCardLogo").InnerText, VipCardBG = node.SelectSingleNode("VipCardBG").InnerText, VipCardQR = node.SelectSingleNode("VipCardQR").InnerText, 
                VipCardName = node.SelectSingleNode("VipCardName").InnerText, VipCardPrefix = node.SelectSingleNode("VipCardPrefix").InnerText, VipRequireName = bool.Parse(node.SelectSingleNode("VipRequireName").InnerText), VipRequireMobile = bool.Parse(node.SelectSingleNode("VipRequireMobile").InnerText), VipRequireAdress = bool.Parse(node.SelectSingleNode("VipRequireAdress").InnerText), VipRequireQQ = bool.Parse(node.SelectSingleNode("VipRequireQQ").InnerText), VipEnableCoupon = bool.Parse(node.SelectSingleNode("VipEnableCoupon").InnerText), EnablePodRequest = bool.Parse(node.SelectSingleNode("EnablePodRequest").InnerText), EnableAppOffLinePay = bool.Parse(node.SelectSingleNode("EnableAppOffLinePay").InnerText), EnableAppPodPay = bool.Parse(node.SelectSingleNode("EnableAppPodPay").InnerText), EnableAppAliPay = bool.Parse(node.SelectSingleNode("EnableAppAliPay").InnerText), EnableAppWapAliPay = bool.Parse(node.SelectSingleNode("EnableAppWapAliPay").InnerText), EnableWapAliPay = bool.Parse(node.SelectSingleNode("EnableWapAliPay").InnerText), IsValidationService = bool.Parse(node.SelectSingleNode("IsValidationService").InnerText), EnableWeiXinRequest = bool.Parse(node.SelectSingleNode("EnableWeiXinRequest").InnerText), EnableOffLineRequest = bool.Parse(node.SelectSingleNode("EnableOffLineRequest").InnerText), 
                EnableWeixinWapAliPay = bool.Parse(node.SelectSingleNode("EnableWeixinWapAliPay").InnerText), WeixinNumber = node.SelectSingleNode("WeixinNumber").InnerText, WeixinLoginUrl = node.SelectSingleNode("WeixinLoginUrl").InnerText, WeiXinCodeImageUrl = node.SelectSingleNode("WeiXinCodeImageUrl").InnerText, OffLinePayContent = node.SelectSingleNode("OffLinePayContent").InnerText, WapTheme = node.SelectSingleNode("WapTheme").InnerText, EnableWapOffLinePay = bool.Parse(node.SelectSingleNode("EnableWapOffLinePay").InnerText), EnableWapPodPay = bool.Parse(node.SelectSingleNode("EnableWapPodPay").InnerText), AliOHAppId = node.SelectSingleNode("AliOHAppId").InnerText, EnableAliOHAliPay = bool.Parse(node.SelectSingleNode("EnableAliOHAliPay").InnerText), AliOHTheme = node.SelectSingleNode("AliOHTheme").InnerText, EnableAliOHOffLinePay = bool.Parse(node.SelectSingleNode("EnableAliOHOffLinePay").InnerText), EnableAliOHPodPay = bool.Parse(node.SelectSingleNode("EnableAliOHPodPay").InnerText), AliOHFollowRelay = node.SelectSingleNode("AliOHFollowRelay").InnerText, AliOHServerUrl = node.SelectSingleNode("AliOHServerUrl").InnerText, EnableVshopShengPay = bool.Parse(node.SelectSingleNode("EnableVshopShengPay").InnerText), 
                EnableWapShengPay = bool.Parse(node.SelectSingleNode("EnableWapShengPay").InnerText), EnableAppShengPay = bool.Parse(node.SelectSingleNode("EnableAppShengPay").InnerText), EnableAliOHShengPay = bool.Parse(node.SelectSingleNode("EnableAliOHShengPay").InnerText), AliOHFollowRelayTitle = node.SelectSingleNode("AliOHFollowRelayTitle").InnerText
             };
        }

        private static void SetNodeValue(XmlDocument doc, XmlNode root, string nodeName, string nodeValue)
        {
            XmlNode newChild = root.SelectSingleNode(nodeName);
            if (newChild == null)
            {
                newChild = doc.CreateElement(nodeName);
                root.AppendChild(newChild);
            }
            newChild.InnerText = nodeValue;
        }

        public void WriteToXml(XmlDocument doc)
        {
            XmlNode root = doc.SelectSingleNode("Settings");
            SetNodeValue(doc, root, "SiteUrl", this.SiteUrl);
            SetNodeValue(doc, root, "AssistantIv", this.AssistantIv);
            SetNodeValue(doc, root, "AssistantKey", this.AssistantKey);
            SetNodeValue(doc, root, "DecimalLength", this.DecimalLength.ToString(CultureInfo.InvariantCulture));
            SetNodeValue(doc, root, "DefaultProductImage", this.DefaultProductImage);
            SetNodeValue(doc, root, "DefaultProductThumbnail1", this.DefaultProductThumbnail1);
            SetNodeValue(doc, root, "DefaultProductThumbnail2", this.DefaultProductThumbnail2);
            SetNodeValue(doc, root, "DefaultProductThumbnail3", this.DefaultProductThumbnail3);
            SetNodeValue(doc, root, "DefaultProductThumbnail4", this.DefaultProductThumbnail4);
            SetNodeValue(doc, root, "DefaultProductThumbnail5", this.DefaultProductThumbnail5);
            SetNodeValue(doc, root, "DefaultProductThumbnail6", this.DefaultProductThumbnail6);
            SetNodeValue(doc, root, "DefaultProductThumbnail7", this.DefaultProductThumbnail7);
            SetNodeValue(doc, root, "DefaultProductThumbnail8", this.DefaultProductThumbnail8);
         
            SetNodeValue(doc, root, "MobelImageUrl9", this.MobelImageUrl9);


            SetNodeValue(doc, root, "DefaultProductImageUrl1", this.DefaultProductImageUrl1);
            SetNodeValue(doc, root, "DefaultProductImageUrl2", this.DefaultProductImageUrl2);
            SetNodeValue(doc, root, "DefaultProductImageUrl3", this.DefaultProductImageUrl3);
            SetNodeValue(doc, root, "DefaultProductImageUrl4", this.DefaultProductImageUrl4);
            SetNodeValue(doc, root, "DefaultProductImageUrl5", this.DefaultProductImageUrl5);

            SetNodeValue(doc, root, "CheckCode", this.CheckCode);
            SetNodeValue(doc, root, "IsOpenSiteSale", this.IsOpenSiteSale ? "true" : "false");
            SetNodeValue(doc, root, "Disabled", this.Disabled ? "true" : "false");
            SetNodeValue(doc, root, "ReferralDeduct", this.ReferralDeduct.ToString(CultureInfo.InvariantCulture));
            SetNodeValue(doc, root, "EtaoID", this.EtaoID);
            SetNodeValue(doc, root, "IsCreateFeed", this.IsCreateFeed ? "true" : "false");
            SetNodeValue(doc, root, "Footer", this.Footer);
            SetNodeValue(doc, root, "RegisterAgreement", this.RegisterAgreement);
            SetNodeValue(doc, root, "HtmlOnlineServiceCode", this.HtmlOnlineServiceCode);
            SetNodeValue(doc, root, "LogoUrl", this.LogoUrl);
            SetNodeValue(doc, root, "OrderShowDays", this.OrderShowDays.ToString(CultureInfo.InvariantCulture));
            SetNodeValue(doc, root, "CloseOrderDays", this.CloseOrderDays.ToString(CultureInfo.InvariantCulture));
            SetNodeValue(doc, root, "FinishOrderDays", this.FinishOrderDays.ToString(CultureInfo.InvariantCulture));
            SetNodeValue(doc, root, "TaxRate", this.TaxRate.ToString(CultureInfo.InvariantCulture));
            SetNodeValue(doc, root, "PointsRate", this.PointsRate.ToString("F"));
            SetNodeValue(doc, root, "SearchMetaDescription", this.SearchMetaDescription);
            SetNodeValue(doc, root, "SearchMetaKeywords", this.SearchMetaKeywords);
            SetNodeValue(doc, root, "SiteDescription", this.SiteDescription);
            SetNodeValue(doc, root, "SiteName", this.SiteName);
            SetNodeValue(doc, root, "Theme", this.Theme);
            SetNodeValue(doc, root, "YourPriceName", this.YourPriceName);
            SetNodeValue(doc, root, "EmailSender", this.EmailSender);
            SetNodeValue(doc, root, "EmailSettings", this.EmailSettings);
            SetNodeValue(doc, root, "SMSSender", this.SMSSender);
            SetNodeValue(doc, root, "SMSSettings", this.SMSSettings);
            SetNodeValue(doc, root, "SiteMapNum", this.SiteMapNum);
            SetNodeValue(doc, root, "TaobaoShippingType", this.TaobaoShippingType.ToString());
            SetNodeValue(doc, root, "SiteMapTime", this.SiteMapTime);
            SetNodeValue(doc, root, "EnabledBFD", this.EnabledBFD ? "true" : "false");
            SetNodeValue(doc, root, "BFDUserName", this.BFDUserName);
            SetNodeValue(doc, root, "EnabledCnzz", this.EnabledCnzz ? "true" : "false");
            SetNodeValue(doc, root, "CnzzUsername", this.CnzzUsername);
            SetNodeValue(doc, root, "CnzzPassword", this.CnzzPassword);
            SetNodeValue(doc, root, "EnableMobileClient", this.EnableMobileClient ? "true" : "false");
            SetNodeValue(doc, root, "MobileClientSpread", this.MobileClientSpread);
            SetNodeValue(doc, root, "CellPhoneUserCode", this.CellPhoneUserCode);
            SetNodeValue(doc, root, "CellPhoneToken", this.CellPhoneToken);
            SetNodeValue(doc, root, "ApplicationMark", this.ApplicationMark);
            SetNodeValue(doc, root, "SiteToken", this.SiteToken);
            SetNodeValue(doc, root, "SiteTime", this.SiteTime);
            SetNodeValue(doc, root, "WeixinAppId", this.WeixinAppId);
            SetNodeValue(doc, root, "WeixinAppSecret", this.WeixinAppSecret);
            SetNodeValue(doc, root, "WeixinToken", this.WeixinToken);
            SetNodeValue(doc, root, "WeixinPaySignKey", this.WeixinPaySignKey);
            SetNodeValue(doc, root, "WeixinPartnerID", this.WeixinPartnerID);
            SetNodeValue(doc, root, "WeixinPartnerKey", this.WeixinPartnerKey);
            SetNodeValue(doc, root, "VTheme", this.VTheme);
            SetNodeValue(doc, root, "VipCardBG", this.VipCardBG);
            SetNodeValue(doc, root, "VipCardLogo", this.VipCardLogo);
            SetNodeValue(doc, root, "VipCardQR", this.VipCardQR);
            SetNodeValue(doc, root, "VipCardPrefix", this.VipCardPrefix);
            SetNodeValue(doc, root, "VipCardName", this.VipCardName);
            SetNodeValue(doc, root, "VipRequireName", this.VipRequireName ? "true" : "false");
            SetNodeValue(doc, root, "VipRequireMobile", this.VipRequireMobile ? "true" : "false");
            SetNodeValue(doc, root, "VipRequireQQ", this.VipRequireQQ ? "true" : "false");
            SetNodeValue(doc, root, "VipRequireAdress", this.VipRequireAdress ? "true" : "false");
            SetNodeValue(doc, root, "VipEnableCoupon", this.VipEnableCoupon ? "true" : "false");
            SetNodeValue(doc, root, "VipRemark", this.VipRemark);
            SetNodeValue(doc, root, "EnableWeiXinRequest", this.EnableWeiXinRequest ? "true" : "false");
            SetNodeValue(doc, root, "EnableOffLineRequest", this.EnableOffLineRequest ? "true" : "false");
            SetNodeValue(doc, root, "EnableWeixinWapAliPay", this.EnableWeixinWapAliPay ? "true" : "false");
            SetNodeValue(doc, root, "OffLinePayContent", this.OffLinePayContent);
            SetNodeValue(doc, root, "IsValidationService", this.IsValidationService ? "true" : "false");
            SetNodeValue(doc, root, "WeixinNumber", this.WeixinNumber);
            SetNodeValue(doc, root, "WeixinLoginUrl", this.WeixinLoginUrl);
            SetNodeValue(doc, root, "WeiXinCodeImageUrl", this.WeiXinCodeImageUrl);
            SetNodeValue(doc, root, "EnableAppOffLinePay", this.EnableAppOffLinePay ? "true" : "false");
            SetNodeValue(doc, root, "EnableAppPodPay", this.EnableAppPodPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableAppAliPay", this.EnableAppAliPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableAppWapAliPay", this.EnableAppWapAliPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableWapAliPay", this.EnableWapAliPay ? "true" : "false");
            SetNodeValue(doc, root, "WapTheme", this.WapTheme);
            SetNodeValue(doc, root, "EnablePodRequest", this.EnablePodRequest ? "true" : "false");
            SetNodeValue(doc, root, "EnableWapOffLinePay", this.EnableWapOffLinePay ? "true" : "false");
            SetNodeValue(doc, root, "EnableWapPodPay", this.EnableWapPodPay ? "true" : "false");
            SetNodeValue(doc, root, "AliOHAppId", this.AliOHAppId);
            SetNodeValue(doc, root, "EnableAliOHOffLinePay", this.EnableAliOHOffLinePay ? "true" : "false");
            SetNodeValue(doc, root, "AliOHTheme", this.AliOHTheme);
            SetNodeValue(doc, root, "EnableAliOHAliPay", this.EnableAliOHAliPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableAliOHPodPay", this.EnableAliOHPodPay ? "true" : "false");
            SetNodeValue(doc, root, "AliOHFollowRelay", this.AliOHFollowRelay);
            SetNodeValue(doc, root, "AliOHFollowRelayTitle", this.AliOHFollowRelayTitle);
            SetNodeValue(doc, root, "AliOHServerUrl", this.AliOHServerUrl);
            SetNodeValue(doc, root, "EnableVshopShengPay", this.EnableVshopShengPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableWapShengPay", this.EnableWapShengPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableAppShengPay", this.EnableAppShengPay ? "true" : "false");
            SetNodeValue(doc, root, "EnableAliOHShengPay", this.EnableAliOHShengPay ? "true" : "false");
        }

        public string AliOHAppId { get; set; }

        public string AliOHFollowRelay { get; set; }

        public string AliOHFollowRelayTitle { get; set; }

        public string AliOHServerUrl { get; set; }

        public string AliOHTheme { get; set; }

        public string ApplicationMark { get; set; }

        public string AssistantIv { get; set; }

        public string AssistantKey { get; set; }

        public string BFDUserName { get; set; }

        public string CellPhoneToken { get; set; }

        public string CellPhoneUserCode { get; set; }

        public string CheckCode { get; set; }

        [RangeValidator(1, RangeBoundaryType.Inclusive, 90, RangeBoundaryType.Inclusive, Ruleset="ValMasterSettings", MessageTemplate="过期几天自动关闭订单的天数必须在1-90之间")]
        public int CloseOrderDays { get; set; }

        public string CnzzPassword { get; set; }

        public string CnzzUsername { get; set; }

        public DateTime? CreateDate { get; set; }

        public int DecimalLength { get; set; }


        //
        public string DefaultProductImage { get; set; }

        public string DefaultProductThumbnail1 { get; set; }

        public string DefaultProductThumbnail2 { get; set; }

        public string DefaultProductThumbnail3 { get; set; }

        public string DefaultProductThumbnail4 { get; set; }

        public string DefaultProductThumbnail5 { get; set; }

        public string DefaultProductThumbnail6 { get; set; }

        public string DefaultProductThumbnail7 { get; set; }

        public string DefaultProductThumbnail8 { get; set; }

        // ImageUrl1, ImageUrl2, ImageUrl3, ImageUrl4, ImageUrl5,
        public string DefaultProductImageUrl1 { get; set; }

        public string DefaultProductImageUrl2 { get; set; }

        public string DefaultProductImageUrl3 { get; set; }
        public string DefaultProductImageUrl4 { get; set; }
        public string DefaultProductImageUrl5 { get; set; }

        public string MobelImageUrl9 { get; set; }


        public bool Disabled { get; set; }

        public bool EmailEnabled
        {
            get
            {
                return (((!string.IsNullOrEmpty(this.EmailSender) && !string.IsNullOrEmpty(this.EmailSettings)) && (this.EmailSender.Trim().Length > 0)) && (this.EmailSettings.Trim().Length > 0));
            }
        }

        public string EmailSender { get; set; }

        public string EmailSettings { get; set; }

        public bool EnableAliOHAliPay { get; set; }

        public bool EnableAliOHOffLinePay { get; set; }

        public bool EnableAliOHPodPay { get; set; }

        public bool EnableAliOHShengPay { get; set; }

        public bool EnableAppAliPay { get; set; }

        public bool EnableAppOffLinePay { get; set; }

        public bool EnableAppPodPay { get; set; }

        public bool EnableAppShengPay { get; set; }

        public bool EnableAppWapAliPay { get; set; }

        public bool EnabledBFD { get; set; }

        public bool EnabledCnzz { get; set; }

        public bool EnableMobileClient { get; set; }

        public bool EnableOffLineRequest { get; set; }

        public bool EnablePodRequest { get; set; }

        public bool EnableVshopShengPay { get; set; }

        public bool EnableWapAliPay { get; set; }

        public bool EnableWapOffLinePay { get; set; }

        public bool EnableWapPodPay { get; set; }

        public bool EnableWapShengPay { get; set; }

        public bool EnableWeiXinRequest { get; set; }

        public bool EnableWeixinWapAliPay { get; set; }

        public DateTime? EtaoApplyTime { get; set; }

        [StringLengthValidator(0, 60, Ruleset="ValMasterSettings", MessageTemplate="一淘账户名称为必填项，长度限制在60字符以内")]
        public string EtaoID { get; set; }

        public int EtaoStatus { get; set; }

        [RangeValidator(1, RangeBoundaryType.Inclusive, 90, RangeBoundaryType.Inclusive, Ruleset="ValMasterSettings", MessageTemplate="发货几天自动完成订单的天数必须在1-90之间")]
        public int FinishOrderDays { get; set; }

        public string Footer { get; set; }

        [StringLengthValidator(0, 0xfa0, Ruleset="ValMasterSettings", MessageTemplate="网页客服代码长度限制在4000个字符以内")]
        public string HtmlOnlineServiceCode { get; set; }

        public bool IsCreateFeed { get; set; }

        public bool IsOpenEtao { get; set; }

        public bool IsOpenSiteSale { get; set; }

        public bool IsValidationService { get; set; }

        public string LogoUrl { get; set; }

        public string MobileClientSpread { get; set; }

        public string OffLinePayContent { get; set; }

        [RangeValidator(1, RangeBoundaryType.Inclusive, 90, RangeBoundaryType.Inclusive, Ruleset="ValMasterSettings", MessageTemplate="最近几天内订单的天数必须在1-90之间")]
        public int OrderShowDays { get; set; }

        [RangeValidator(typeof(decimal), "0.1", RangeBoundaryType.Inclusive, "10000000", RangeBoundaryType.Inclusive, Ruleset="ValMasterSettings", MessageTemplate="几元一积分必须在0.1-10000000之间")]
        public decimal PointsRate { get; set; }

        public int ReferralDeduct { get; set; }

        public string RegisterAgreement { get; set; }

        public DateTime? RequestDate { get; set; }

        [StringLengthValidator(0, 260, Ruleset="ValMasterSettings", MessageTemplate="店铺描述META_DESCRIPTION的长度限制在260字符以内"), HtmlCoding]
        public string SearchMetaDescription { get; set; }

        [StringLengthValidator(0, 160, Ruleset="ValMasterSettings", MessageTemplate="搜索关键字META_KEYWORDS的长度限制在160字符以内")]
        public string SearchMetaKeywords { get; set; }

        [StringLengthValidator(0, 100, Ruleset="ValMasterSettings", MessageTemplate="简单介绍TITLE的长度限制在100字符以内")]
        public string SiteDescription { get; set; }

        public string SiteMapNum { get; set; }

        public string SiteMapTime { get; set; }

        [StringLengthValidator(1, 60, Ruleset="ValMasterSettings", MessageTemplate="店铺名称为必填项，长度限制在60字符以内")]
        public string SiteName { get; set; }

        public string SiteTime { get; set; }

        public string SiteToken { get; set; }

        [StringLengthValidator(1, 0x80, Ruleset="ValMasterSettings", MessageTemplate="店铺域名必须控制在128个字符以内")]
        public string SiteUrl { get; set; }

        public bool SMSEnabled
        {
            get
            {
                return (((!string.IsNullOrEmpty(this.SMSSender) && !string.IsNullOrEmpty(this.SMSSettings)) && (this.SMSSender.Trim().Length > 0)) && (this.SMSSettings.Trim().Length > 0));
            }
        }

        public string SMSSender { get; set; }

        public string SMSSettings { get; set; }

        public int TaobaoShippingType { get; set; }

        [RangeValidator(typeof(decimal), "0", RangeBoundaryType.Inclusive, "100", RangeBoundaryType.Inclusive, Ruleset="ValMasterSettings", MessageTemplate="税率必须在0-100之间")]
        public decimal TaxRate { get; set; }

        public string Theme { get; set; }

        public int? UserId { get; private set; }

        public string VipCardBG { get; set; }

        public string VipCardLogo { get; set; }

        public string VipCardName { get; set; }

        public string VipCardPrefix { get; set; }

        public string VipCardQR { get; set; }

        public bool VipEnableCoupon { get; set; }

        public string VipRemark { get; set; }

        public bool VipRequireAdress { get; set; }

        public bool VipRequireMobile { get; set; }

        public bool VipRequireName { get; set; }

        public bool VipRequireQQ { get; set; }

        public string VTheme { get; set; }

        public string WapTheme { get; set; }

        public string WeixinAppId { get; set; }

        public string WeixinAppSecret { get; set; }

        public string WeiXinCodeImageUrl { get; set; }

        public string WeixinLoginUrl { get; set; }

        public string WeixinNumber { get; set; }

        public string WeixinPartnerID { get; set; }

        public string WeixinPartnerKey { get; set; }

        public string WeixinPaySignKey { get; set; }

        public string WeixinToken { get; set; }

        [StringLengthValidator(0, 10, Ruleset="ValMasterSettings", MessageTemplate="“您的价”重命名的长度限制在10字符以内")]
        public string YourPriceName { get; set; }
    }
}

